package com.easygem.front.converter;

import com.easygem.common.model.front.ClientType;
import com.easygem.common.vo.front.ClientTypeVo;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author luoxi
 * @version 1.0
 * @className ClientTypeConverter
 * @Description 客户类型
 * 用于返回给前端的实体转换器
 * @date 2024/12/26 21:43
 */
public class ClientTypeConverter {
    /**
     * 转vo  ,用于返回给前端的实体
     * @return
     */
    public static ClientTypeVo converterToClientTypeVo(ClientType clientType){
        ClientTypeVo clientTypeVo = new ClientTypeVo();
        BeanUtils.copyProperties(clientType,clientTypeVo);
        return clientTypeVo;
    }
    public static List<ClientTypeVo> converterToClientTypeVoList(List<ClientType> clientTypes){
        List<ClientTypeVo> clientTypeVoList = new ArrayList<ClientTypeVo>();
        for(ClientType clientType : clientTypes){
            clientTypeVoList.add(converterToClientTypeVo(clientType));
        };
        return clientTypeVoList;
    }
}
